<?php
$cat_slug = pods_url_variable('last');
$cat_pod_item = new Pod('category', $cat_slug);
$cat_name = ucwords($cat_pod_item->get_field('name'));
$list_view_deal = new Pod('deal');
$where = "t.camp_end > ".fix_date()." && t.daily = 0 && camp_cat.url='".$cat_slug."'";
$list_view_deal->findRecords('id DESC', 15, $where);
?>
<h1 id="f_margin"><?php echo $cat_name.' Deals'; ?></h1>
<?php buzzr_fb_like(); ?>
<div class="clear"></div>
<div class="filter">
  <div class=views>
	  <a class="grid g-button">Grid View</a>
	  <a class="list g-button">List View</a>
  </div>
  <div class="sort">Sort by
	  <a class="g-button" href="<?php echo BUZZR_URL.'/deals'; ?>">Latest</a>
	  <a class="g-button" href="<?php echo BUZZR_URL.'/deals-popular'; ?>">Popular</a>
  </div>
  <div class="clear"></div>
</div>
	
<div id="list_wrap">
	<ul class="list">
	<?php
		echo $list_view_deal->showTemplate('list_grid');
  	?>
	</ul>
</div>
<div class="clear"></div>
	<div>
		<?php echo $list_view_deal->getPagination(); ?>
</div>